package com.wubo.sec.service;

import java.util.List;

import javax.annotation.security.RolesAllowed;

import com.wubo.sec.model.Group;

/**
 * 
 * @author wubo
 * @CreateDate 2010-8-2
 * @version 1.0.01
 */
public interface IGroupService {
	@RolesAllowed({"ADMIN", "GROUP_READ"})
	List<String[]> listName(String name);
	
	@RolesAllowed({"ADMIN", "GROUP_READ"})
    List<String[]> listMark(String mark);
	
	@RolesAllowed({"ADMIN", "GROUP_ADD"})
	String create(Group group);
	
	@RolesAllowed({"ADMIN", "GROUP_UPDATE", "ACL_PUT"})
	Group update(Group group);
	
	@RolesAllowed({"ADMIN", "GROUP_DELETE", "ACL_DEL"})
	void delete(Group group);
	
	Group get(String code);
	
	@RolesAllowed({"ADMIN", "GROUP_READ"})
	List<Group> findAll();
	
	@RolesAllowed({"ADMIN", "GROUP_READ"})
	List<Group> find(String filter, Object[] params);
	
	List<Group> findRunAs(String filter, Object[] params);
	
	@RolesAllowed({"ADMIN", "GROUP_READ"})
	List<Group> getSplitPage(int start, int limit, String filter, Object... params);
	
	@RolesAllowed({"ADMIN", "GROUP_READ"})
	long getTotal(String filter, Object... params);
	
	List<Group> findAccessibleGroups(int priority, String mark, Group group);
}
